#!/usr/bin/env python3

import rospy
from DrEmpower_can.msg import read_property
# import DrEmpower as dr

def callback(data):
    import DrEmpower as dr
    value = dr.read_property(id_num=data.id_num, property=data.property)
    rospy.loginfo("read_property_node: %f" , value)


def listener():
    rospy.init_node("read_property", anonymous=True)
    rospy.Subscriber("read_property", read_property, callback)
    rospy.spin()


if __name__ == '__main__':
    listener()

